// 评论相关接口

// 手动导入配置号的axios
import axios from '@/utils/request'

// 获取评论或评论回复
export const getComments = function (params) {
  return axios({
    url: '/v1_0/comments',
    method: 'get',
    params
  })
}

// 为评论/回复  点赞
export const addLike = function (target) {
  return axios({
    method: 'post',
    url: '/v1_0/comment/likings',
    data: { target }
  })
}

// 为评论/回复  取消点赞
export const disLike = function (target) {
  return axios({
    method: 'delete',
    url: '/v1_0/comment/likings/' + target
  })
}

// 发表评论
// eslint-disable-next-line camelcase
export const addComments = function (target, content, art_id) {
  return axios({
    url: '/v1_0/comments',
    method: 'post',
    data: {
      target,
      content,
      art_id
    }
  })
}
